package vip.rssc.mybatis.mapper;

import org.apache.ibatis.annotations.*;
import vip.rssc.mybatis.entity.TestUser;

import java.util.List;

/**
 * <p>Description: [TestUserMapper]</p >
 * Created on 2020年10月25日
 *
 * @author <a href="1014376159@qq.com">CJ</a>
 * @version 1.0
 * Copyright (c) 2020 cj
 */
@Mapper
public interface TestUserMapper {

    @Insert(value = "insert into test_user(name,age,birthday,remark) values (#{name},#{age},#{birthday},#{remark})")
    void save(TestUser testUser);

    @Update(value = "update test_user set name=#{name},age=#{age},birthday=#{birthday},remark=#{remark} where id=#{id}")
    void updateById(TestUser testUser);

    @Delete("delete from test_user where id=#{id}")
    void deleteById(Long id);

    //@Select(value = "select * from test_user where id = #{id}")
    TestUser selectById(Long id);

    @Select(value = "select * from test_user")
    List<TestUser> selectList();

}
